A = imread('cameraman.tif');
[x,y] = size(A);
for i = 1 : x
  for j = 1 : y/2
      tempimg = A(i,j);
      A(i,j) = A(i,y-j+1);
      A(i,y-j+1) = tempimg;
  end
end
imshow(A);